Skip to content

Add Matter water valve support and example sketch - #182

Merged
Tamas Jozsi (silabs-bozont) merged 3 commits into
SiliconLabsSoftware:mainfrom
lboue:Matter-WaterValve
Aug 24, 2026
Merged

Add Matter water valve support and example sketch#182
Tamas Jozsi (silabs-bozont) merged 3 commits into
SiliconLabsSoftware:mainfrom
lboue:Matter-WaterValve

Conversation

@lboue

@lboue Ludovic BOUÉ (lboue) commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Add Matter Water Valve support

Summary

  • Adds a new MatterWaterValve Arduino API on top of the Matter Valve Configuration and Control cluster (device type 0x0042), following the existing Device/MatterEndpoint pattern used by other Matter appliances in this core.
  • Adds the backing DeviceWaterValve class (libraries/Matter/src/devices/DeviceWaterValve.{h,cpp}) implementing CurrentState, TargetState, OpenDuration, DefaultOpenDuration, RemainingDuration, and ValveFault attributes, plus HandleReadEmberAfAttribute/HandleWriteEmberAfAttribute overrides.
  • Adds MatterWaterValve.{h,cpp} with a public API to open the valve indefinitely or for a set duration, close it, and read/write duration and fault state, along with a command handler for the cluster's Open/Close commands.
  • Registers the new device type in MatterEndpoint.h (DEVICE_TYPE_WATER_VALVE) and devices/MatterDevice.h (kDeviceType_WaterValve).
  • Adds the matter_watervalve example sketch demonstrating commissioning, opening the valve with a countdown duration, closing it, and mirroring valve state on the built-in LED.
  • Registers the new example in test/build/test_build.py under testlist_matter so it's built by CI across all Matter-capable boards.
image

@silabs-bozont Tamas Jozsi (silabs-bozont) added the Community contribution PR contents contributed by the community label Jul 6, 2026
@lboue
Ludovic BOUÉ (lboue) marked this pull request as ready for review July 6, 2026 16:11
@silabs-bozont Tamas Jozsi (silabs-bozont) added Under review Request or issue under review Run CI Matter Run Matter specific build tests labels Jul 8, 2026
@github-actions github-actions Bot removed the Run CI Matter Run Matter specific build tests label Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for implementing this - it'll be a great addition to the library. I've tested it with Home Assistant - works as expected. I had a few minor remarks, after fixing them we're good to go.

Comment thread libraries/Matter/examples/matter_water_valve/matter_water_valve.ino
Comment thread libraries/Matter/examples/matter_watervalve/matter_watervalve.ino Outdated
Comment thread libraries/Matter/src/MatterWaterValve.cpp Outdated
Comment thread libraries/Matter/examples/matter_water_valve/matter_water_valve.ino
Comment thread libraries/Matter/src/MatterWaterValve.h Outdated
@lboue

Ludovic BOUÉ (lboue) commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Push fixes into 067c73a

Restricts the public setter to defined fault values instead of an
arbitrary uint16_t, per PR review feedback.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread libraries/Matter/src/MatterWaterValve.cpp Outdated
OpenDuration, DefaultOpenDuration, RemainingDuration, CurrentState and
TargetState are all nullable per spec, and OpenDuration/DefaultOpenDuration
have a min value of 1, so "no duration configured" must be represented as
null rather than 0. Without ATTRIBUTE_MASK_NULLABLE, writes of null (e.g.
clearing DefaultOpenDuration from Home Assistant) were rejected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@silabs-bozont

Copy link
Copy Markdown
Collaborator

Just noticed that the docs are missing for this from the library's readme.md for the valve - we can add it in a separate PR.

@silabs-bozont
Tamas Jozsi (silabs-bozont) merged commit 23c6291 into SiliconLabsSoftware:main Aug 24, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 24, 2026
@silabs-bozont Tamas Jozsi (silabs-bozont) removed the Under review Request or issue under review label Aug 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Community contribution PR contents contributed by the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants